#ifndef BLOCK_H
#define BLOCK_H

#include "drawable.h"
#include "physicsable.h"

class Block : public Drawable, public Physicsable {
    private: 
    float r;
    float g;
    float b;
	
	cpVect * vertii_;
	int numVertii_;

	Block() {
	}
    
    public:
		Block(cpVect pos, cpVect direction, float width, float height, float mass) : Drawable(2),
																					 Physicsable(BLOCK, mass) {
		float hWidth = width / 2;
		float hHeight = height / 2;
		
		numVertii_ = 4;
		vertii_ = new cpVect[numVertii_];
		vertii_[0].x = -hWidth; vertii_[0].y =  hHeight;
		vertii_[1].x =  hWidth; vertii_[1].y =  hHeight;
		vertii_[2].x =  hWidth; vertii_[2].y = -hHeight;
		vertii_[3].x = -hWidth; vertii_[3].y = -hHeight;
		
		addPolyShape(0.0, numVertii_, vertii_, cpvzero);
		getBody()->p = pos;
		getBody()->a = -cpvtoangle(direction);
        
        r = 1.0;
        g = 0.0;
        b = 0.0;
    }

		void draw();
    
    //void update(float step);

	//void collide();
};

#endif

